//
//  CRInputToolBar.h
//  TestPrj
//
//  Created by 朱铅峰 on 2020/8/3.
//  Copyright © 2020 Xing. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "CRHeader.h"
#import "ProxyTextView.h"

#pragma mark - 输入栏代理

@protocol CRInputToolBarDelegate <NSObject>

@optional

- (BOOL)textViewShouldBeginEditing;

- (void)textViewDidEndEditing;

- (BOOL)shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)replacementText;

- (void)textViewDidChange;

- (void)toolBarWillChangeHeight:(CGFloat)height;

- (void)toolBarDidChangeHeight:(CGFloat)height;

@end




#pragma mark - 输入栏

@interface CRInputToolBar : UIView

proStrong UIButton *voiceButton;//[文字｜录音]切换按钮
proStrong UIButton *emoticonBtn;//表情按钮
proStrong UIButton *moreMediaBtn;//更多面板按钮
proStrong UIButton *recordButton;//录音按钮
proStrong UIImageView *inputTextBkgImage;//文字输入背景按钮
proStrong ProxyTextView *inputTextView;//文字输入

proStrong NSArray *inputBarItemTypes;//当前支持的操作按钮类型集合
proAssign BOOL showsKeyboard;//键盘显示状态
proWeak id<CRInputToolBarDelegate> delegate;//代理
proAssign NSInteger maxNumberOfInputLines;//文本框最大行数
proCopyString contentText;//输入框当前文本

/// 切换状态
/// @param status 显示状态
- (void)updateStatus:(CRInputStatus)status;

@end



#pragma mark - 输入栏文本框处理方法

@interface CRInputToolBar(InputText)

- (NSRange)selectedRange;

- (void)setPlaceHolder:(NSString *)placeHolder;

- (void)insertText:(NSString *)text;

- (void)deleteText:(NSRange)range;

@end
